<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>修改</title>
    <%--需要引入各种css、js、jquery的插件--%>
    <script type="text/javascript" src="easyui1.7/jquery.min.js"></script>
    <script type="text/javascript" src="easyui1.7/jquery.easyui.min.js"></script>
    <script type="text/javascript" src="easyui1.7/locale/easyui-lang-zh_CN.js"></script>
    <link rel="stylesheet" type="text/css" href="easyui1.7/themes/default/easyui.css"/>
    <link rel="stylesheet" type="text/css" href="easyui1.7/themes/icon.css"/>
</head>
<body>
<form action="update" method="post" enctype="multipart/form-data">
    游戏名称: <input type="text" required="required" name="name" value="${game.name}"><br>
    是否氪金: <input type="radio" name="money" <c:if test="${game.money=='是'}">checked="checked"</c:if> value="是">是
    <input type="radio" name="money" <c:if test="${game.money=='否'}">checked="checked"</c:if> value="否">否
    <br>
    游戏logo: <input type="file" required="required" name="imgFile">
    <input type="hidden" value="${game.img}">
    <img src="/img/${game.img}" width="30" height="30">
    <br>
    研发公司:
    <select name="a" id="a" onchange="getB()">
        <option value="${cpm[0]}">${cmp[0]}</option>
    </select>
    <select name="b" id="b">
        <option value="${cpm[1]}">${cmp[1]}</option>
    </select>
    <br>
    <input type="submit" value="提交">
    <input type="reset" value="重置">
</form>
</body>
<script>
    $.post("findA",{"cid":0},function (data) {
        for (var i in data){
            $('#a').append("<option class='a' id="+data[i].id+">"+data[i].cname+"</option>")
        }
    })
    function getB() {
        var cid = $('.a:selected').attr("id");
        $.post("findA",{"cid":cid},function (data) {
            $('#b').empty();
            $('#b').append("<option>请选择</option>");
            for (var i in data){
                $('#b').append("<option  id="+data[i].id+">"+data[i].cname+"</option>")
            }
        })
    }
</script>
</html>
